<template>
  <div style="line-height: 34px !important;">
    <el-button v-if="params.data.passwordType === '1' && isAuth('exercisesPwdView')" title="需要密码" icon="icon iconfont icon-mimabianji" type="primary" circle size="small"
      @click="passwordEdit(params.data.row)"></el-button>
    <el-button v-if="params.data.passwordType !== '1' && isAuth('exercisesCommonView')" title="编辑" icon="icon iconfont icon-bianji" type="primary" circle size="small"
      @click="edit(params.data.row)"></el-button>
    <el-button v-if="isAuth('exercisesDel')" title="删除" icon="icon iconfont icon-shanchu" type="danger" circle size="small"
      @click='delItem(params.data.row)'></el-button>
    <el-button v-if="isAuth('exercisesResetPwd')  && params.data.passwordType === '1'" title="重置密码" icon="icon iconfont icon-zhongzhimima" type="warning" circle size="small"
      @click='resetItem(params.data.row)'></el-button>
  </div>
</template>
<script>
import Vue from 'vue'
export default Vue.extend({
  // props: ["flag"],
  data () {
    return {}
  },
  methods: {
    edit () {
      this.params.context.componentParent.edit(this.params.data)
    },
    passwordEdit () {
      this.params.context.componentParent.passwordEdit(this.params.data)
    },
    delItem () {
      this.params.context.componentParent.delItem(this.params.data)
    },
    delHandle () {
      this.params.context.componentParent.delHandle(this.params.data)
    },
    importHandle () {
      this.params.context.componentParent.importHandle(this.params.data)
    },
    resetItem () {
      this.params.context.componentParent.resetItem(this.params.data)
    }
  }
})
</script>
